package user.zc.action.comp;

import javax.swing.*;

/**
 * @author zhouchuang
 * @date 2023/8/11 13:43
 */
public class Required extends InputVerifier {

    @Override
    public boolean verify(JComponent input) {
        JTextField tf = (JTextField)input;
        String text = tf.getText();
        if(text.length()==0){
            JOptionPane.showMessageDialog(null, "该字段必填");
            return false;
        }else{
            return true;
        }
    }
}
